package zm.irc.message.processor;

import zm.irc.cfg.IrcConfig;
import zm.irc.client.IrcClient;
import zm.irc.ioc.annotation.AutoWired;
import zm.irc.ioc.annotation.Service;
import zm.irc.message.receive.IrcReceiveMessage;
import zm.irc.weechat.WeechatClient;


@Service(isSinglet = true)
public class WeechatRouteProcessor implements IrcMessageProcessor{
  
    @AutoWired
    private IrcConfig ircConfig;

    @AutoWired
    private WeechatClient wClient;



    @Override
    public boolean processor(IrcClient client, IrcReceiveMessage receivedMsg) {
        
            String channel = receivedMsg.getChannel();
       
            if( client.isListenning(channel)){
                this.wClient.send(receivedMsg);
            }
            
        
        return true;
    }

}
